package cn.socket.tcp;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * tcp 快速入门 发送端口
 */
public class TcpSend {
    public static void main(String[] args) throws IOException {
        //tcp核心类

            Socket tcp = new Socket("192.168.59.1", 10000);
            OutputStream out = tcp.getOutputStream();
            //写出数据
            byte[] data = "hello i am tcp".getBytes();
            out.write(data, 0, data.length);
            tcp.close();
            out.close();

    }
}
